package com.anxin.act.task.cmd;

import org.activiti.engine.impl.context.Context;
import org.activiti.engine.impl.interceptor.Command;
import org.activiti.engine.impl.interceptor.CommandContext;
import org.activiti.engine.impl.persistence.entity.TaskEntity;
import org.activiti.engine.impl.pvm.process.ActivityImpl;

import java.util.Map;

/**
 * @author: liuxiangyu
 * @date: 2020/8/10 01:27
 */
public class DeleteTaskCmd implements Command<Void> {

    private TaskEntity currentTaskEntity;

    public DeleteTaskCmd(TaskEntity currentTaskEntity) {
        this.currentTaskEntity = currentTaskEntity;
    }

    @Override
    public Void execute(CommandContext commandContext) {
        Context.getCommandContext().getTaskEntityManager().deleteTask(currentTaskEntity, TaskEntity.DELETE_REASON_DELETED, false);
        //Context.getCommandContext().getTaskEntityManager().de
        return null;
    }
}
